import { Body, Controller, Delete, Get, Post, Put, Query } from '@nestjs/common';
import { SeriesService } from './series.service';

@Controller('series')
export class SeriesController {
    constructor(
        private readonly seriesService: SeriesService
    ) { }

    @Post('add')
    add(@Body() body: any) {
        return this.seriesService.add(body);
    }

    @Delete('delete')
    delete(@Body() body: any) {
        return this.seriesService.delete(body.id);
    }

    @Put('update')
    update(@Body() body: any) {
        return this.seriesService.update(body.id, body);
    }

    @Get()
    index(@Query() query: any) {
        return this.seriesService.findAll(query);
    }
}
